import request from '@/utils/request'
import {
  getCookiesUserInfo,
} from "@/utils/auth";

/**
 * 获取招商/招标列表
 */
export function getAnnouncemeList (data) {
  return request({
    url: '/basic-api/company/comInvestmentAnnouncement/annList',
    method: 'get',
    params: data
  })
}

/**
 * 企业前端-获取企业基本信息
 */
export function getClientUseAnnnouncemeList (data) {
  return request({
    // url: '/basic-api/company/comCompany/api/v1/company/list',
    // url: '/basic-api/company/comCompany/clientList',
    url: '/basic-api/company/noAuth/comInvestmentAnnouncementList',
    params: data
  })
}



/**
 * 获取招商/招标详情
 */
export function getAnnouncemeDetailById (id) {
  return request({
    url: '/basic-api/company/comInvestmentAnnouncement/annGetInfo/' + id,
    method: 'get',
  })
}

/**
 * 添加招商/招标
 */
export function addAnnounceme (data) {
  data.approvalSt = 0
  data.companyId = JSON.parse(getCookiesUserInfo()).companyId
  return request({
    url: '/basic-api/company/comInvestmentAnnouncement/annAdd',
    method: 'POST',
    data
  })
}

/**
 * 编辑招商/招标
 */
export function editAnnounceme (data) {
  return request({
    url: '/basic-api/company/comInvestmentAnnouncement/annEdit',
    method: 'put',
    data
  })
}

/**
 * 删除招商/招标
 */
export function delAnnounceme (id) {
  return request({
    url: '/basic-api/company/comInvestmentAnnouncement/annRemove/' + id,
    method: 'delete',
  })
}
